package com.zeyu.framework.monitor.controller;

import com.zeyu.framework.common.entity.WorkConstant;
import com.zeyu.framework.common.utils.WorkUtil;
import lombok.RequiredArgsConstructor;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author zeyu
 */
@Controller("monitorView")
@RequestMapping(WorkConstant.VIEW_PREFIX + "monitor")
@RequiredArgsConstructor
public class ViewController {

    @GetMapping("online")
    @RequiresPermissions("online:view")
    public String online() {
        return WorkUtil.view("monitor/online");
    }

    @GetMapping("log")
    @RequiresPermissions("log:view")
    public String log() {
        return WorkUtil.view("monitor/log");
    }

    @GetMapping("loginlog")
    @RequiresPermissions("loginlog:view")
    public String loginLog() {
        return WorkUtil.view("monitor/loginLog");
    }

    @GetMapping("httptrace")
    @RequiresPermissions("httptrace:view")
    public String httptrace() {
        return WorkUtil.view("monitor/httpTrace");
    }
}
